package com.ruoyi.quartz.task;

/**
 * 操作结果类
 * @param <T> 结果数据类型
 */
public class OperateResult<T> {
    private boolean succeed;     // 是否成功
    private String message;     // 消息
    private long costTime;      // 耗时(毫秒)
    private T value;           // 结果值
    
    /**
     * 默认构造函数
     */
    public OperateResult() {
    }
    
    /**
     * 构造函数
     * @param succeed 是否成功
     * @param message 消息
     * @param costTime 耗时
     */
    public OperateResult(boolean succeed, String message, long costTime) {
        this.succeed = succeed;
        this.message = message;
        this.costTime = costTime;
    }
    
    /**
     * 构造函数
     * @param succeed 是否成功
     * @param message 消息
     * @param costTime 耗时
     * @param value 结果值
     */
    public OperateResult(boolean succeed, String message, long costTime, T value) {
        this.succeed = succeed;
        this.message = message;
        this.costTime = costTime;
        this.value = value;
    }
    
    public boolean isSucceed() {
        return succeed;
    }
    
    public void setSucceed(boolean succeed) {
        this.succeed = succeed;
    }
    
    public String getMessage() {
        return message;
    }
    
    public void setMessage(String message) {
        this.message = message;
    }
    
    public long getCostTime() {
        return costTime;
    }
    
    public void setCostTime(long costTime) {
        this.costTime = costTime;
    }
    
    public T getValue() {
        return value;
    }
    
    public void setValue(T value) {
        this.value = value;
    }
}